# Created by: Li-Wen Hsu <lwhsu@FreeBSD.org>
# $FreeBSD: head/textproc/py-sphinx/Makefile 301002 2012-07-17 12:46:02Z nivit $
#

PORTNAME=	sphinx
PORTVERSION=	1.2.b2
CATEGORIES=	textproc python
MASTER_SITES=	CHEESESHOP
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
DISTNAME=	Sphinx-${PORTVERSION:C/([0-9]*)\.(b[0-9]*)$/\1\2/}
DIST_SUBDIR=	python

MAINTAINER=	lwhsu@FreeBSD.org
COMMENT=	Python documentation generator

LICENSE=	BSD

RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}pygments>=1.6:${PORTSDIR}/textproc/py-pygments \
		${PYTHON_PKGNAMEPREFIX}Jinja2>=2.7:${PORTSDIR}/devel/py-Jinja2 \
		${PYTHON_PKGNAMEPREFIX}docutils>=0.11:${PORTSDIR}/textproc/py-docutils \
		${PYTHON_PKGNAMEPREFIX}Babel>=1.3:${PORTSDIR}/devel/py-babel

USE_PYTHON=	yes
USE_PYDISTUTILS=	easy_install
PYDISTUTILS_PKGNAME=	Sphinx
PYDISTUTILS_PKGVERSION=	${PORTVERSION:C/([0-9]*)\.(b[0-9]*)$/\1\2/}

PLIST_SUB=	PYTHON_VER=${PYTHON_VER}

.include <bsd.port.pre.mk>

.if ${PYTHON_REL} >= 320
.include "${PORTSDIR}/devel/py-virtualenv/files/py3k-fix-pkg-plist.inc"
.endif

post-install:
	@${SETENV} PYTHONPATH=${PYTHONPREFIX_SITELIBDIR} \
	${PYTHON_CMD} -m sphinx.pycode.pgen2.driver -c 'import load_grammar'

.include <bsd.port.post.mk>
